﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Manager.master" AutoEventWireup="true" CodeFile="ComposeMail.aspx.cs" Inherits="User_ComposeMail" %>
<%@ Register assembly="CKEditor.NET" namespace="CKEditor.NET" tagprefix="CKEditor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript">
        jQuery(document).ready(function () {
            jQuery("#Composeform").validate();

            jQuery("#<%= txtReceiver.ClientID %>,#<%= txtSubject.ClientID %>").focus(function () {
                jQuery(this).removeAttr("style").css('width','100%');
            });
        });
        function checkValidate() {
            var receiver = jQuery("#<%= txtReceiver.ClientID %>");
            var subject = jQuery("#<%= txtSubject.ClientID %>");
            var content = jQuery("#<%= CKEditorControl1.ClientID %>");
            var msg = jQuery("#<%= lblMsg.ClientID %>");
            var flag = false;
            if (receiver.val() == "") {
                receiver.css('border', '1px solid #C00000');
                flag = true;
            }
            if (subject.val() == "") {
                subject.css('border', '1px solid #C00000');
                flag = true;
            }
            if (CKEDITOR.instances['<%=CKEditorControl1.ClientID %>'].getData().val() == "") {
                content.css('border', '1px solid #C00000');
                flag = true;
            }
            return (flag)? false : true;
        }
    </script>
    <div style="margin:0 auto">
        <div class="content_area1">
            <h1>Soạn thư</h1>
            <div style="margin-left:20px;">
                <form id="Composeform" method="get" action="">
                <table>
                    <tr>
                        <td>Gửi đến</td>
                        <td><asp:TextBox ID="txtReceiver" runat="server" Width="100%"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>Nhập email hoặc tên đăng nhập. Mỗi tài khoản cách nhau bằng dấu ,</td>
                    </tr>
                    <tr>
                        <td>Tiêu đề</td>
                        <td><asp:TextBox ID="txtSubject" runat="server" Width="100%" CssClass="required"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <CKEditor:CKEditorControl ID="CKEditorControl1" runat="server" Width="627px" Height="300px" CssClass="required" 
                                FilebrowserWindowFeatures="location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=mo,scrollbars=yes" 
                                ResizeEnabled="False" ToolbarFull="Preview|Cut|Copy|Paste|PasteText|PasteFromWordBold|Italic|Link|Unlink|Underline|Undo|Redo|Format|Font|FontSize">
                            </CKEditor:CKEditorControl>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <div class="LeftOfButton">
                                <div class="RightOfButton">
                                    <div class="MidOfButton">
                                        <asp:LinkButton runat="server" ID="Compose" OnClick="Compose_Click" OnClientClick="return checkValidate();" Text="Gửi"></asp:LinkButton>
                                    </div>
                                </div>
                            </div>
                            <div class="LeftOfButton">
                                <div class="RightOfButton">
                                    <div class="MidOfButton">
                                        <a href="<%= ResolveUrl("~/Mailbox.html")%>">Hủy</a>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Literal ID="lblMsg" runat="server"></asp:Literal>
                        </td>
                    </tr>
                </table>
                </form>
            </div>
            <br class="clear" />
            <img src="<%= ResolveUrl("~/images/bottom.jpg")%>" align="absbottom" alt="" />
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>

